/**
 * 功能描述 导航栏
 */

define(function (require, exports, module) {
	var Subnav = require("subnav");
	var appointRoomBarComp = require('./appointRoomBarComp');
	var Dialog = require("dialog");
    var instance = {
        initComponent:function (params,widget){
        	var isToDetail = true;
        	var urls=null;
        	if(params && params.source == "CheckInSignUp"){
        		isToDetail = false;
        	}        	
        	var subnav=new Subnav({
        		parentNode:".J-subnav",
        		model:{
            		title:"房态全景",
            		items:[{
        	            id: "toDetail",
        	            type: "button",
        	            text: "在住预约统计",
        	            show:isToDetail,
        	            handler:function(key,element){
        	            	widget.openView({
        						url:"eling/elcms/travel/livebookstatistics/src/livebookstatistics_main",
        						params:{
        							type:"roomstatewhole"
        						},
        						isAllowBack:true
        					});
        	            }            		
            		},{
        	            id: "appointSum",
        	            type: "button",
        	            text: "预定汇总",
        	            show:isToDetail,
        	            handler:function(key,element){
        	            	widget.appointSumEvent(params,widget);        	            	
        	            }            		
            		},{
        	            id: "print",
        	            type: "button",
        	            text: "房态打印",
        	            show:isToDetail,
        	            handler:function(key,element){
        	            	window.open("assets/roomstateprint.html?print=print");        	            	
        	            }            		
            		},{
        	            id: "checkoutsettlement",
        	            type: "button",
        	            text: "团队退房结算",
        	            show:false,
        	            handler:function(key,element){
        	            	if(widget.get("checkOutStatus")=="CheckOut"){
        	            		widget.openView({
            	            		url:"eling/elcms/travel/checkoutsettlement/src/checkoutsettlement_main",
            						params:{
            							pkCIImplement:widget.get("pkCIImplement"),
            							type:"roomstatewhole"
            						},
            						isAllowBack:true
            					});
        	            	}else{
        	            		Dialog.alert({
				    				content:"此房间未查房！"
				            	});
        	            	}
        	            }            		
            		},{
        	            id: "nonmemcheckout",
        	            type: "button",
        	            text: "散客退房结算",
        	            show:false,
        	            handler:function(key,element){
        	            	if(widget.get("checkOutStatus")=="CheckOut"){
        	            		widget.openView({
            						url:"eling/elcms/travel/nonmemcheckout/src/nonmemcheckout_main",
            						params:{
            							pkCIImplement:widget.get("pkCIImplement"),
            							type:"roomstatewhole"
            						},
            						isAllowBack:true
            					});
        	            	}else{
        	            		Dialog.alert({
				    				content:"此房间未查房！"
				            	});
        	            	}
        	            }            		
            		},{
        	            id: "checkin",
        	            type: "button",
        	            text: "团队入住登记",
        	            show:false,
        	            handler:function(key,element){
        	            	widget.openView({
        						url:"eling/elcms/travel/checkin/src/checkin_main",
        						params:{
        							type:"roomstatewhole"
        						},
        						isAllowBack:true
        					});
        	            }            		
            		},{
        	            id: "scattercheckin",
        	            type: "button",
        	            text: "散客入住登记",
        	            show:false,
        	            handler:function(key,element){
        	            	widget.openView({
        						url:"eling/elcms/travel/scattercheckin/src/scattercheckin_main",
        						params:{
        							type:"roomstatewhole"
        						},
        						isAllowBack:true
        					});
        	            }            		
            		},{
						id:"return",
						type:"button",
						text:"返回",
						show : false,
						handler:function(){
							widget.toCard();
						}
					}]
        		}
        	});
        	widget.set("subnav",subnav);

        }
    };
    module.exports = instance;
});
